import http from '../utils/http'
/**
 * 代取快递下单
 * @param {*} data 
 * @param {*} cbFunc 
 */
function pickPlace(data, cbFunc) {
  http.post('/order/pick/place', data).then(res => {
    cbFunc(res)
  })
}
/**
 * 上门服务下单
 * @param {*} data 
 * @param {*} cbFunc 
 */
function servPlace(data, cbFunc) {
  http.post('/order/serv/place', data).then(res => {
    cbFunc(res)
  })
}
/**
 * 商品下单
 * @param {*} data 
 * @param {*} cbFunc 
 */
function itemPlace(data, cbFunc) {
  http.post('/order/item/place', data).then(res => {
    cbFunc(res)
  })
}
/**
 * 我的订单列表
 * @param {*} data 
 * @param {*} cbFunc 
 */
function list(data, cbFunc) {
  http.get('/order/list', data).then(res => {
    cbFunc(res)
  })
}
/**
 * 我的订单详情
 * @param {*} data 
 * @param {*} cbFunc 
 */
function detail(data, cbFunc) {
  http.get('/order/detail', data).then(res => {
    cbFunc(res)
  })
}


module.exports = {
  pickPlace: pickPlace,
  servPlace: servPlace,
  itemPlace: itemPlace,
  list: list,
  detail: detail
}